package com.dao.qsl;

import com.util.qsl.Dbutil;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

@Repository
public class XqMc {
      public List<String> xqname(){
	  Dbutil d=new Dbutil();
	  Connection c=null;

	  List<String> list=new ArrayList<>();
	  try {
	        c=d.getConnection();
	        String sql="SELECT vname from village";

	        PreparedStatement pr=c.prepareStatement(sql);

	        ResultSet rs=pr.executeQuery();

	        while (rs.next()) {
		    list.add(rs.getString("vname"));
	        }
	  }catch(Exception e){
	        e.printStackTrace();
	  }
	  return list;
      }
}
